package com.huabo.contract.mysql.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.contract.mysql.entity.TblLegalArbitrationrecordMySql;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-03-22
 */
public interface TblLegalArbitrationrecordMySqlMapper extends BaseMapper<TblLegalArbitrationrecordMySql> {

    @Select("SELECT * FROM TBL_LEGAL_ARBITRATIONRECORD WHERE ARBITRATIONINFO = #{arbitraId}")
    List<TblLegalArbitrationrecordMySql> findListBynegotiaId(Integer arbitraId);

    @InsertProvider(type = TblLegalArbitrationrecordMySqlMapperSqlConfig.class, method = "saveNegotiateRecord")
    @Options(useGeneratedKeys=true, keyProperty="arrecordid", keyColumn="ARRECORDID")
    void saveNegotiateRecord(TblLegalArbitrationrecordMySql record);

    @Select("SELECT * FROM TBL_LEGAL_ARBITRATIONRECORD WHERE ARRECORDID = #{arrecordId}")
    TblLegalArbitrationrecordMySql findByArrecordId(Integer arrecordId);

    @UpdateProvider(type = TblLegalArbitrationrecordMySqlMapperSqlConfig.class, method = "modifyNegotiateRecord")
    void modifyNegotiateRecord(TblLegalArbitrationrecordMySql oldRecord);

    @Delete("DELETE FROM TBL_LEGAL_ARBITRATIONRECORD WHERE ARRECORDID = #{arrecordId}")
    void removeNegitiateRecord(Integer arrecordId);

    @SelectProvider(type = TblLegalArbitrationrecordMySqlMapperSqlConfig.class, method = "findListByPageInfo")
    List<TblLegalArbitrationrecordMySql> findListByPageInfo(PageInfo<TblLegalArbitrationrecordMySql> pageInfo, Integer arrecordid);

    @SelectProvider(type = TblLegalArbitrationrecordMySqlMapperSqlConfig.class, method = "findListByPageInfoCount")
    Integer findListByPageInfoCount(Integer arbitraid);
}
